const app = new Vue({
  data: {
    bmiList: []
  },
  created() {
    const self = this
    $.ajax({
      type: "GET",
      url: "https://veihwwnelcwq.leanapp.cn/bmi",
      success(res) {
        console.log(res)
        self.bmiList = res.data
      }
    })
    /*fetch("http://yizhanketang.com:1010/api/v1/bmi")
      .then(res => res.json())
      .then(res => {
        this.bmiList = res
        console.log(res)
      })*/
  },
  mounted() {
    $("body").css({
      backgroundColor: "#fefefe"
    })
  },
  methods: {
    del(id) {
      const self = this
      $.ajax({
        type: "DELETE",
        url: "https://veihwwnelcwq.leanapp.cn/bmi",
        data: {
          id
        },
        success(res) {
          console.log(res)
        }
      })
    }
  }
}).$mount("#app")




